interface Student{
    name: string;
    age: number;
    exam?: number;
    [propname: string]: any;
    work(): string
}
// 接口的继承
interface Monitor extends Student {
    shouzuoye(): string;
}
// 接口应用实例
const monitor = (teacher: Monitor) => {
    console.log("名字:" + teacher.name);
    console.log("年龄:" + teacher.age);
    teacher.exam ? console.log("成绩" + teacher.exam) : console.log("此人无成绩");
    console.log(teacher.work());
    console.log(teacher.shouzuoye());
}
const xiaohei = {
    name: "小黑", 
    age: 36,
    work() {
        return "学习就是我的工作"
    },
    shouzuoye(){
        return "大家把作业交给我"
    }
}
// 以传值的形式调用方法
monitor(xiaohei);